<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Client extends Model
{
    protected $guarded = ['id'];

    public function clientCar()
    {
    	return $this->hasMany(ClientCar::class);
    }

    public function getCarNumAttribute()
    {
    	return $this->clientCar->count();
    }

    public function task()
    {
    	return $this->hasMany(Task::class);
    }

    public function users()
    {
        return $this->hasMany(ClientUser::class);
    }
}
